package jnBase.view
{
	import ui.tools.wap.txtDialogWAPUI;
	/**
	 *文本对话框：
	 * 实验目的
	 * 实验方法
	 * 注意事项 
	 * @author Administrator
	 * 
	 */	
	public class TxtDialogWAP extends txtDialogWAPUI
	{
		private var prevX:Number = 0;
		private var prevY:Number = 0;
		private var data:Array=[];
		private static var _ins:TxtDialog;
		public static const  CLOSE_DIALOG:String="dialogClose";
		private var wid:Number;
		private var heg:Number;
		private var text:String;
		private var tit:String;
		/**
		 *文本对话框  带一个标题 
		 * @param $wid 对话框宽度
		 * @param $heg 对话框高度
		 * @param $text	要显示的文本
		 * 
		 */		
		public function TxtDialogWAP($wid:Number,$heg:Number,$text:String="",$tit:String="")
		{
			dragArea="0,0,"+$wid+",96";
			wid=$wid;
			heg=$heg;
			size(wid,heg);
			text=$text;
			tit=$tit;
		}
		
		override public function onAwake():void
		{
			// TODO Auto Generated method stub
			super.onAwake();
			p.vScrollBar.autoHide=true;
			p.vScrollBar.elasticBackTime=500;
			p.vScrollBar.elasticDistance=200;
			this.img.width=wid;
			this.img.height=heg;
			setText(text);
			title.text=tit;
		}
		public function setText($text:String):void{
			txt.style.fontSize=32;
			txt.style.padding=[0,0,0,0];
			txt.style.color='#ffffff';
			txt.style.lineHeight=70;
			txt.style.letterSpacing=2;
			txt.style.width=wid-150;
			txt.style.valign="middle";
//			txt.style.cssText("font-size:62px");
			txt.innerHTML=$text;
		}
		override public function onClosed(type:String=null):void
		{
			// TODO Auto Generated method stub
			super.onClosed(type);
			event(CLOSE_DIALOG);
		}
		/**
		 *设置对话框的标题 
		 * @param $str
		 * 
		 */		
		public function setTitle($str:String):void{
			title.text=$str;
		}
	}
}